module.exports = (api) => {
  api.injectFeature({
    name: "Linter / Formatter",
    value: "linter",
    short: "Linter",
    description:
      "选择代码格式化配置(Check and enforce code quality with ESLint or Prettier)",
    link: "https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint",
    checked: true,
  });

  // 注入新的选项
  api.injectPrompt({
    name: "eslintConfig",
    when: (answer) => {
      return (
        answer.features instanceof Array && answer.features.includes("linter")
      );
    },
    type: "list",
    message: "选择一种eslint模板(Pick a linter template)",
    description:
      "Checking code errors and enforcing an homogeoneous code style is recommended.",
    choices: [
      {
        name: "ESLint + Airbnb config",
        value: "airbnb",
        short: "Airbnb",
      },
      {
        name: "ESLint + Stabdard config",
        value: "standard",
        short: "Standard",
      },
    ],
  });

  // api.injectPrompt({
  //     name: 'lintOn',
  //     message: 'Pick Additional lint features:',
  //     when: answer => answer.features.includes('linter'),
  //     type: 'checkbox',
  //     choices: [
  //         {
  //             name: 'Lint on save',
  //             value: 'save',
  //             checked: true
  //         },
  //         {
  //             name: 'Lint and fix on commit',
  //             value: 'commit'
  //         }
  //     ]
  // })
};
